package com.itheima.test02;

import java.io.*;

public class Test04 {

    public static void main(String[] args) throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("day12\\copy\\a.jpg"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("day12\\copy\\d.jpg"));
        long start = System.currentTimeMillis();
        byte[] bytes= new byte[1024];
        int len;
        while ((len=bis.read(bytes))!=-1){
            bos.write(bytes,0,len);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制使用了" +(end - start)
        );//复制使用了25
        bis.close();
        bos.close();
    }
}
